#!/usr/bin/python3

line = input('Please enter a line, # to end:\n')

def print_sorted(line):
    words = line.split()
    words.sort()
    for word in words:
        print(word, end=' ')
    print()

while line != '#' :
    print_sorted(line)
    line = input('Please enter a line, # to end:\n')